livewire model array

49

<form wire:submit.prevent="save">
    @foreach ($posts as $index => $post)
        <div wire:key="post-field-{{ $post->id }}">
            <input type="text" wire:model="posts.{{ $index }}.title">
 
            <textarea wire:model="posts.{{ $index }}.content"></textarea>
        </div>
    @endforeach
 
    <button type="submit">Save</button>
</form>

Comments

Submit
0 Comments